package com.yunfei.mapper.aiiidb;

import com.yunfei.api.v2.qiuzhi.result.HuiDaResult;
import com.yunfei.api.v2.qiuzhi.result.QiuZhiResult;
import com.yunfei.bo.*;
import com.yunfei.mapper.BaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
    * tPersonalUserSystem 实体类
    * Sun Apr 08 11:56:27 CST 2018 zhengyunfei
    */

@Mapper
public interface SkQuesDtlMapper<T> extends BaseDao<T> {
	/**
	*新增
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 void add(SkQuesDtlBo bo);
	/**
	*批量新增
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 String batchInsert(List bo);
	/**
	*修改
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 String update(SkQuesDtlBo bo);
	/**
	*删除
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 String delete(String id);
	/**
	*根据Id查询
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	SkQuesDtlBo findById(String id);
	/**
	*根据Id查询
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	SkQuesDtlBo findByMap(Map queryMap);
	/**
	*查询所有信息
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 List<T> findAllList(T bo);
	/**
	*查询所有信息
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 List<SkQuesDtlBo> findAllList(Map<String, Object> queryMap);
	/**
	*查询所有信息
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 List<SkQuesDtlBo> findAllList(SkQuesDtlBo bo, int curNo, int curSize);
	/**
	*根据Id查询
	*@author zhengYunFei
	*@date Sun Apr 08 11:56:27 CST 2018
	*/
	 int count(T bo);

	SkQuesDtlBo findByBo(SkQuesDtlBo param);
	String getCurrentUserId(HttpServletRequest request);
	/**
	 * 保存用户基本信息到redis中
	 * @author zhengyunfei
	 */
	void saveUserToRedis(SkQuesDtlBo userBo);

	/**
	 * 更新子女基本信息redis缓存
	 * @author zhengyunfei
	 * @param request
	 * @param childList
	 */
	void updateUserInfoChildrensToRedis(HttpServletRequest request, List<TPersonalUserChildBo> childList);
	void updateUserInfoChildrensToRedis(HttpServletRequest request, List<TPersonalUserChildBo> childList, String userId);

	/**
	 * 从缓存中获取用户信息
	 * @author zhengyunfei
	 * @param request
	 * @param modelMap
	 */
	SkQuesDtlBo getUserInfoFromRedis(HttpServletRequest request, ModelMap modelMap);

	/**
	 * 从缓存中获取子女基本信息
	 * @author zhengyunfei
	 * @param request
	 * @param modelMap
	 */
	List<TPersonalUserChildBo> getUserInfoChildrensFromRedis(HttpServletRequest request, ModelMap modelMap);
	/**
	 * 从缓存中获取子女基本信息
	 * @author zhengyunfei
	 * @param request
	 * @param modelMap
	 */
	List<TPersonalUserChildBo> getUserInfoChildrensFromRedis(HttpServletRequest request, ModelMap modelMap, String userId);
	/**
	 * 根据userId获取用户基本信息
	 * @author zhengyunfei
	 * @param userId 传递的用户id
	 */
	SkQuesDtlBo getUserInfoFromRedis(String userId) ;
	/*
	*根据随机数，判断是否可以发送验证码
	 */
	 boolean isSendCodeFlag(String r);
	/**
	 * @Description: 在需要发送短信的页面，必须调用此方法，并返回随机码给页面，发送验证码的时候，页面需要回传此随机码给发送验证码的方法，校验正确，才可以发送验证码
	 * 生成随机码的有效期是5分钟
	 * @Author: zhengyunfei
	 * @Date: 2018/5/11
	 * @time:16:44
	 */
	 void createCodeRandom(Model model);
	/**
	 * @Description: 校验验证码是否正确
	 * @return: boolean
	 * @Author: zhengyunfei
	 * @Date: 2018/5/14
	 * @time:17:41
	 */
	 boolean isCodeSuccess(String mobile, String code);

    String getLiCaiShiInfo(String userId);

    List<KeFuUserBo> getKeFuUserList(KeFuUserBo page);

	int getKeFuUserListSize(KeFuUserBo param);
	//发送短信和邮件给客服
	boolean sendMessageAndMailToKeFu(SkQuesDtlBo userBo);
	//判断邀请码是否存在
	int getYqmExsit(SkQuesDtlBo userBo);

    List<LiCaiShiUserBo> getLiCaiShiUserList(LiCaiShiUserBo queryParam);

	int getLiCaiShiUserListSize(LiCaiShiUserBo queryParam);
	int getReportStatus(String mobile);

	List<SkQuesDtlBo> getCrmUserMobileList();
	//更新用户登录次数
    void updateLoginCount(SkQuesDtlBo personalUserBoParam);

	String getLiCaiShiUserId(SkQuesDtlBo SkQuesDtlBo);

	List<SkQuesDtlBo> findAllListPage(SkQuesDtlBo skQuesDtlBo, int parseInt, int parseInt1);

	List<SkQuesDtlBo> findAllListPage(Map<String, Object> queryMap);
	List<SkQuesDtlBo> findAllListPage(SkQuesDtlBo skQuesDtlBo);

	T getMoreHuidaQuestion(Map<String, Object> questionMap);
	List<T> getMoreHuidaAnswers(Map<String, Object> questionMap);
}

